<?php
if(!isset($path))
{
	$path="Reports/Excel/";
}

require 'Classes/PHPExcel.php';
require_once 'Classes/PHPExcel/IOFactory.php';
$objPHPExcel = PHPExcel_IOFactory::load($path.$filename);

$dataarr=array();
$i=0;
foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
    $worksheetTitle     = $worksheet->getTitle();
    $highestRow         = $worksheet->getHighestRow(); // e.g. 10
    $highestColumn      = $worksheet->getHighestColumn(); // e.g 'F'
    $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);
    $nrColumns = ord($highestColumn) - 64;
    
    if($highestRow>=2 && $highestColumnIndex>0)
    {
    	$dataarr[$i]=array();
		$j=0;
	}
	for ($row = 2; $row <= $highestRow; ++ $row) {
		
		
		if($highestColumnIndex>0)
	    {
	    	$cell = $worksheet->getCellByColumnAndRow(0, $row);
            $val = $cell->getValue();
            if((trim($val)=="" || $val==null))
            {
				break;
			}
			else
			{
		    	$dataarr[$i][$j]=array();
				$k=0;
			}
		}
		
        for ($col = 0; $col < $highestColumnIndex; ++ $col) {
        	
            $cell = $worksheet->getCellByColumnAndRow($col, $row);
            $val = $cell->getValue();
            $dataType = PHPExcel_Cell_DataType::dataTypeForValue($val);
            
            if($col==0 && (trim($val)=="" || $val==null))
            {
				break;
			}
           
            
            $dataarr[$i][$j][$k]=$val;
            $k++;
        }
        $j++;
        
    }
    $i++;
    
}



?>